home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act2 / 00252.ls < prev    next >
Encoding:
Text File  |  1995-03-28  |  5.2 KB  |  207 lines

  1. on countem
  2.   global wnum, rewardlist, TRIAL, bugstatus, gametwolevel, bugcount, direction, mysound, afterhint
  3.   set afterhint to "presto"
  4.   if count(rewardlist) = 0 then
  5.     set rewardlist to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
  6.   end if
  7.   set qq to 0
  8.   repeat with nums = 1 to 10
  9.     if sprite (10 + nums) intersects 3 then
  10.       setAt(bugstatus, nums, 1)
  11.     else
  12.       setAt(bugstatus, nums, 0)
  13.     end if
  14.     if getAt(bugstatus, nums) = 1 then
  15.       set qq to qq + 1
  16.     end if
  17.   end repeat
  18.   if qq = wnum then
  19.     if (gametwolevel = 2) and (TRIAL < 3) then
  20.       set othercast to getAt(rednumcast, wnum + 1)
  21.       set finalcast to getAt(numbercast, wnum + 1)
  22.       set the castNum of sprite 47 to othercast
  23.       updateStage()
  24.       repeat with xxx = 1 to 5
  25.         set the ink of sprite 47 to 4
  26.         updateStage()
  27.         set the ink of sprite 47 to 0
  28.         updateStage()
  29.       end repeat
  30.     end if
  31.     if not (TRIAL > 3) then
  32.       set mysound to "Small Crowd Cheering"
  33.       play frame "play audio no mouth"
  34.     end if
  35.     play frame "close door"
  36.     if TRIAL <= 3 then
  37.       set xxx to random(count(rewardlist))
  38.       set rewardanim to "Reward" & getAt(rewardlist, xxx)
  39.       deleteAt(rewardlist, xxx)
  40.       go(rewardanim)
  41.     else
  42.       go("main")
  43.     end if
  44.   else
  45.     set TRIAL to TRIAL + 1
  46.     if qq < wnum then
  47.       set bugcount to "lessthan"
  48.     else
  49.       set bugcount to "greaterthan"
  50.     end if
  51.     if gametwolevel = 1 then
  52.       Level1Wrong(qq)
  53.     else
  54.       if gametwolevel = 2 then
  55.         Level2Wrong(qq)
  56.       else
  57.         Level3Wrong(qq)
  58.       end if
  59.     end if
  60.     if afterhint = "main" then
  61.       play frame "close door"
  62.     end if
  63.     go(afterhint)
  64.   end if
  65. end
  66.  
  67. on Level1Wrong qq
  68.   global wnum, TRIAL, direction, mysound, numbercast, rednumcast, afterhint
  69.   if TRIAL = 1 then
  70.     play frame "Hint1"
  71.   else
  72.     if TRIAL = 2 then
  73.       if qq < wnum then
  74.         play frame "Hint2.2"
  75.       else
  76.         play frame "Hint2.1"
  77.       end if
  78.     else
  79.       if TRIAL = 3 then
  80.         if qq < wnum then
  81.           play frame "Hint2.2"
  82.         else
  83.           play frame "Hint2.1"
  84.         end if
  85.         set othercast to getAt(rednumcast, wnum + 1)
  86.         set finalcast to getAt(numbercast, wnum + 1)
  87.         set the castNum of sprite 47 to othercast
  88.         updateStage()
  89.         repeat with xxx = 1 to 10
  90.           set the ink of sprite 47 to 4
  91.           updateStage()
  92.           set the ink of sprite 47 to 0
  93.           updateStage()
  94.         end repeat
  95.         countbugs()
  96.         set mysound to "put " & wnum
  97.         play frame "Hint3.size"
  98.       else
  99.         if TRIAL > 3 then
  100.           play frame "Hint3"
  101.           set mysound to "now" & wnum
  102.           play frame "Hint3.size"
  103.           correctbugs()
  104.           countbugs()
  105.           set afterhint to "main"
  106.         end if
  107.       end if
  108.     end if
  109.   end if
  110. end
  111.  
  112. on Level2Wrong qq
  113.   global wnum, TRIAL, direction, mysound, numbercast, rednumcast, afterhint
  114.   if TRIAL = 1 then
  115.     play frame "Hint1"
  116.   else
  117.     if TRIAL = 2 then
  118.       if qq < wnum then
  119.         play frame "Hint2.2"
  120.       else
  121.         play frame "Hint2.1"
  122.       end if
  123.       if direction = 1 then
  124.         play frame "level 2.missing"
  125.       else
  126.         play frame "level 2.next"
  127.       end if
  128.     else
  129.       if TRIAL = 3 then
  130.         if qq < wnum then
  131.           play frame "Hint2.2"
  132.         else
  133.           play frame "Hint2.1"
  134.         end if
  135.         set othercast to getAt(rednumcast, wnum + 1)
  136.         set finalcast to getAt(numbercast, wnum + 1)
  137.         set the castNum of sprite 47 to othercast
  138.         updateStage()
  139.         repeat with xxx = 1 to 10
  140.           set the ink of sprite 47 to 4
  141.           updateStage()
  142.           set the ink of sprite 47 to 0
  143.           updateStage()
  144.         end repeat
  145.         countbugs()
  146.         set mysound to "missing" & wnum
  147.         play frame "Hint3.size"
  148.       else
  149.         if TRIAL > 3 then
  150.           play frame "Hint3"
  151.           set mysound to "now" & wnum
  152.           play frame "Hint3.size"
  153.           correctbugs()
  154.           countbugs()
  155.           set afterhint to "main"
  156.         end if
  157.       end if
  158.     end if
  159.   end if
  160. end
  161.  
  162. on Level3Wrong qq
  163.   global wnum, TRIAL, direction, rightsprite, mysound, numbercast, rednumcast, afterhint
  164.   if TRIAL = 1 then
  165.     play frame "Hint1"
  166.   else
  167.     if TRIAL = 2 then
  168.       if qq < wnum then
  169.         play frame "Hint2.2"
  170.       else
  171.         play frame "Hint2.1"
  172.       end if
  173.       play frame "level3." & direction
  174.     else
  175.       if TRIAL = 3 then
  176.         if qq < wnum then
  177.           play frame "Hint2.2"
  178.         else
  179.           play frame "Hint2.1"
  180.         end if
  181.         set othercast to getAt(rednumcast, wnum + 1)
  182.         set finalcast to getAt(numbercast, wnum + 1)
  183.         set the castNum of sprite rightsprite to othercast
  184.         updateStage()
  185.         repeat with xxx = 1 to 10
  186.           set the ink of sprite rightsprite to 4
  187.           updateStage()
  188.           set the ink of sprite rightsprite to 0
  189.           updateStage()
  190.         end repeat
  191.         countbugs()
  192.         set mysound to "Hint Level 3 (" & direction & " " & wnum & ")"
  193.         play frame "Hint3.size"
  194.       else
  195.         if TRIAL > 3 then
  196.           play frame "Hint3"
  197.           set mysound to "now" & wnum
  198.           play frame "Hint3.size"
  199.           correctbugs()
  200.           countbugs()
  201.           set afterhint to "main"
  202.         end if
  203.       end if
  204.     end if
  205.   end if
  206. end
  207.